// src/config/proxy.ts
export const proxyConfig = {
  '/api': {
    target: 'https://api.themoviedb.org/3',
    changeOrigin: true,
    rewrite: (path) => path.replace(/^\/api/, ''),
    onProxyReq(proxyReq, req, res) {
      console.log('代理请求:', {
        originalUrl: req.originalUrl,
        path: proxyReq.path,
        headers: proxyReq.getHeaders()
      });
    },
    onProxyRes(proxyRes, req, res) {
      console.log('代理响应:', {
        statusCode: proxyRes.statusCode,
        headers: proxyRes.headers
      });
    }
  }
};
